package com.example.flowable.listener;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;
import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.delegate.ExecutionListener;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class HuiqianStartListener implements ExecutionListener {
    @Override
    public void notify(DelegateExecution delegateExecution) {
        log.info("执行监听器start事件");
        Map<String, Object> map = new HashMap<>();
        map.put("agree", 0);
        map.put("reject", 0);
        List<String> assigneeList = new ArrayList<>();
        assigneeList.add("user1");
        assigneeList.add("user2");
        assigneeList.add("user3");
        assigneeList.add("user4");
        map.put("assigneeList", assigneeList);
        // System.out.println("HuiqianStartListener");
        delegateExecution.setVariables(map);
    }
}
